//
//  Home_VC.h
//  KaChing_App
//
//  Created by Jordan Robert Yust on 3/21/09.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "DataManager.h"
#import "AsyncImageView.h"

@interface Home_VC : UIViewController <UITableViewDelegate, UITableViewDataSource>
{
	/* Fields from KaChing's API */
	NSString *userName;								// The user's name
	NSString *oneDay_Perf_AsString;					// The users performance in past day
	NSString *oneWeek_Perf_AsString;				// The users performance in past week
	
	
	IBOutlet UIView *imagePlaceHolder;				// Used for holding the profile image
	IBOutlet UITableView *standingsTableView;		// The Performance table
	IBOutlet UITableView *wallTableView;			// The table that holds the wall posts
	IBOutlet UILabel *availableCashLabel;			// The label that displays the available cash
	IBOutlet UILabel *shortCollateralLabel;			// The label that that displays the user's short Callateral
	IBOutlet UILabel *totalValueLabel;				// THe label that displays the net worth of the user's protfolio
	
	DataManager *dataManager;		// The dataManager object
	
	NSDateFormatter *dateFormatter;					// Used for formatting dates
	NSDateFormatter *timeStampInputFormatter;		// Used in formatting wall post
	NSDateFormatter *timeStampOutputFormatter;		// Used in formatting wall post
	NSNumberFormatter *numberFormatter;				// Used in formatting numbers
	
	NSDictionary *wall;								//The user's wall
	
}

/* PROPERTIES */
@property(nonatomic, retain) NSDateFormatter *dateFormatter;
@property(nonatomic, retain) NSDateFormatter *timeStampInputFormatter;
@property(nonatomic, retain) NSDateFormatter *timeStampOutputFormatter;
@property(nonatomic, retain) NSNumberFormatter *numberFormatter;

@property(nonatomic, retain) NSString *userName;
@property(nonatomic, retain) NSString *oneDay_Perf_AsString;
@property(nonatomic, retain) NSString *oneWeek_Perf_AsString;
@property(nonatomic, retain) IBOutlet UILabel *availableCashLabel;
@property(nonatomic, retain) IBOutlet UILabel *shortCollateralLabel;
@property(nonatomic, retain) IBOutlet UILabel *totalValueLabel;

@property(nonatomic, retain) IBOutlet UIView *imagePlaceHolder;
@property(nonatomic, retain) IBOutlet UITableView *standingsTableView;
@property(nonatomic, retain) IBOutlet UITableView *wallTableView;
@property(nonatomic, retain) NSDictionary *wall;
@property(nonatomic, retain) DataManager *dataManager;


/* METHODS */
- (IBAction) refreshData;
- (void) createFormatters;

-(void) configure_FirstRow_Standings:(UITableViewCell *) cell;
-(void) configure_SecondRow_Standings:(UITableViewCell *) cell;
-(void) configure_ThirdRow_Standings:(UITableViewCell *) cell;


@end
